/**
 * @description 朋友圈的模式验证
 * @author malin
 */

const validate = require('./_validator')

const SCHEMA = {
    type:'object',
    properties: {
        content: {
            type: 'string',
            minLength: 1,
            maxLength: 255
        },
        image: {
            type: 'string',
            minLength: 0
        }
    }
}

/**
 * pyq模式验证器（在中间件里执行）
 * @param {*} schema 
 * @param {*} data 
 */
function pyqValidator(data = {}) {
    return validate(SCHEMA, data)
}

module.exports = pyqValidator
